package com.sc.nft.entity.vo;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sc.nft.enums.MarketTypeEnum;
import com.sc.nft.enums.OrderStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

@Data
@NoArgsConstructor
public class SecondOrderExportListVO {
    @ApiModelProperty("藏品Id")
    private Long collectionId;
    @ApiModelProperty("订单编号")
    private String orderNo;
    @ApiModelProperty("藏品标题")
    private String firstTitle;
    @ApiModelProperty("藏品编号")
    private String numbering;
    @ApiModelProperty("购买价格")
    private BigDecimal buyPrice;
    @ApiModelProperty("手续费")
    private BigDecimal charge;
    @ApiModelProperty("交易时间")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date dealTime;
    @ApiModelProperty("实际到账金额")
    private BigDecimal realAmount;
    @ApiModelProperty("防囤罚没金额")
    private BigDecimal preventHoard;
    @ApiModelProperty("买家手机号")
    private String buyUserTel;
    @ApiModelProperty("卖家手机号")
    private String saleUserTel;
    @ApiModelProperty("交易类型")
    @JsonIgnore
    private Integer marketType;
    @ApiModelProperty("交易类型")
    private String marketTypeName;

    public String getMarketTypeName() {
        MarketTypeEnum marketTypeEnum = MarketTypeEnum.getMarketTypeEnum(this.marketType);
        if (ObjectUtil.isNotNull(marketTypeEnum)){
            return marketTypeEnum.getDescription();
        }
        return StrUtil.EMPTY;
    }
}
